{/*
* @author PSI
* @copyright 2015 - present
* @license GPL v3
*/}
<layout name="layout" />

<script src="{$uri}Public/Scripts/PSI/SLN0001/Warehouse/WarehouseField.js?dt={$dtFlag}" type="text/javascript"></script>
<script src="{$uri}Public/Scripts/PSI/User/UserField.js?dt={$dtFlag}" type="text/javascript"></script>
<script src="{$uri}Public/Scripts/PSI/SLN0001/Supplier/SupplierField.js?dt={$dtFlag}" type="text/javascript"></script>
<script src="{$uri}Public/Scripts/PSI/SLN0001/Goods/GoodsWithPurchasePriceField.js?dt={$dtFlag}"
  type="text/javascript"></script>
<script src="{$uri}Public/Scripts/PSI/SLN0001/Goods/GoodsEditForm.js?dt={$dtFlag}" type="text/javascript"></script>
<script src="{$uri}Public/Scripts/PSI/SLN0001/Goods/GoodsCategoryField.js?dt={$dtFlag}" type="text/javascript"></script>
<script src="{$uri}Public/Scripts/PSI/SLN0001/Goods/GoodsBrandField.js?dt={$dtFlag}" type="text/javascript"></script>

<script src="{$uri}Public/Scripts/PSI/SLN0001/Supplier/SupplierEditForm.js?dt={$dtFlag}" type="text/javascript"></script>

<script src="{$uri}Public/Scripts/PSI/SLN0001/Goods/GoodsField.js?dt={$dtFlag}" type="text/javascript"></script>
<script src="{$uri}Public/Scripts/PSI/SLN0001/Goods/GoodsUnitField.js?dt={$dtFlag}" type="text/javascript"></script>

<script src="{$uri}Public/Scripts/PSI/SLN0001/Purchase/PWMainForm.js?dt={$dtFlag}" type="text/javascript"></script>

<!-- GoodsPrice会mix到PWEditForm，所以需要放在其前面引用 -->
<script src="{$uri}Public/Scripts/PSI/Mix/GoodsPrice.js?dt={$dtFlag}" type="text/javascript"></script>
<script src="{$uri}Public/Scripts/PSI/SLN0001/Purchase/PWEditForm.js?dt={$dtFlag}" type="text/javascript"></script>

<script src="{$uri}Public/Scripts/PSI/UX/CellEditing.js?dt={$dtFlag}" type="text/javascript"></script>

<if condition='$enableLodop eq 1'>
  <script src="{$uri}Public/Lodop/LodopFuncs.js?dt={$dtFlag}" type="text/javascript"></script>
</if>

<script>
  PCL.onReady(() => {
    const app = PCL.create("PSI.App", {
      userName: "{$loginUserName}",
      productionName: "{$productionName}",
      appHeaderInfo: {
        title: "{$title}"
      }
    });

    const permission = {
      add: "{$pAdd}",
      edit: "{$pEdit}",
      del: "{$pDelete}",
      commit: "{$pCommit}",
      genPDF: "{$pGenPDF}",
      showAddGoodsButton: "{$showAddGoodsButton}",
      viewPrice: "{$pViewPrice}",
      print: "{$pPrint}"
    };
    app.add(PCL.create("PSI.SLN0001.Purchase.PWMainForm", {
      permission
    }));
  });
</script>
